package com.ListDemo;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @Author milian
 * @Date 2021/7/24 0024 20:01
 */
public class hw3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("aaa");
        arrayList.add("bbb");
        arrayList.add("ccc");
        arrayList.add("aaa");
        arrayList.add("bbb");
        arrayList.add("bbb");
        System.out.println("请输入：");
        String s = scanner.nextLine();
//        arrayList.contains(s);
        for (String str:arrayList
             ) {
            if (str.equals(s)){
                System.out.println("存在");
            }
        }

    }
}
